<?php
if(!defined('MY_ROOT'))
{throw new Exception('Access Denied');}
class SESSION{
public static $config;
public static function init($config)
{
self::$config=$config;
if(isset($config['session_path']))
{
session_save_path($config['session_path']);
}
$lifetime=intval($config['life']);
if(isset($_SERVER['X-SCG-AUTH']))
{
if(isset($_POST['sid'])){
$sid=authcode($_POST['sid'],'DECODE');
session_id($id);
}
}else{
session_set_cookie_params($lifetime,$config['path'],$config['domain']);
}
session_start();
$_SESSION['on']=time();
}
public static function clean()
{
session_destroy();
}

}
?>
